Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@lage-run/target-graph
Advanced tools
This package is concerned about the target graph. The target is a unit of work that gets spawned in a child process eventually be a scheduler + target runner. The main focus of this package are:
Target
interface.TargetGraphBuilder
that handles prioritization, cycle detection, subgraph generation.WorkspaceTargetGraphBuilder
that will take in PackageInfos
object with some task (dependency) configuration and builds a direct-acyclic graph of the targets.TargetFactory
that can generate "global" or "package" level Target
s.For the case (the typical lage
CLI case) where we want to use the shorthand syntax to specify a task graph combining with a package dependency graph, this is the right Builder implementation.
const rootDir = getWorkspaceRoot(process.cwd());
const packageInfos = getPackageInfos(rootDir);
const builder = new WorkspaceTargetGraphBuilder(rootDir, packageInfos);
const tasks = ["build", "test"];
const packages = ["package-a", "package-b"];
builder.addTargetConfig("build", {
dependsOn: ["^build"],
});
const targetGraph = builder.build(tasks, packages);
const builder = new TargetGraphBuilder();
const target1 = {...};
const target2 = {...};
const target3 = {...};
builder.addTarget(target1);
builder.addTarget(target2);
builder.addTarget(target3);
builder.addDependency(target1.id, target2.id);
const graph = builder.build();
The resultant targetGraph
will have a signature of this shape:
interface TargetGraph {
targets: Map<string, Target>;
dependencies: [string, string][];
}
const root = "/some/repo/root";
const resolver = (packageName: string) => {
return `packages/${packageName}`;
};
const factory = new TargetFactory({ root, resolver });
const target = factory.createPackageTarget("a", "build", {
... // `TargetConfig`
});
Target
This is merely an interface that contains enough information to let the runner & scheduler know what to run. The "how" of how to run a target resides in the scheduler and a separate runner implementation.
FAQs
Target for Lage
The npm package @lage-run/target-graph receives a total of 2,141 weekly downloads. As such, @lage-run/target-graph popularity was classified as popular.
We found that @lage-run/target-graph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.